#include "PageDisplay.h"

/**
 * \short Construct a new PageDisplay object. 
 * 
 * Construct a new PageDisplay object.
 */

PageDisplay::PageDisplay() {
  page = NULL;
  textPageLabel = new QLabel(this);
}

/**
 * \short Clean the PageDisplay
 *
 * Clean the PageDisplay
 */

PageDisplay::~PageDisplay() {
  if(textPageLabel != NULL) {
    delete textPageLabel;
  }
}

/**
 * \short Update the Teletext page with the given picture. 
 * 
 * Update the Teletext page with the given picture. 
 * \param tpage The pixmap of the new page. 
 */

void PageDisplay::update(QPixmap *tpage) {
  qDebug() << "PageDisplay::update()";
  page = tpage;
  textPageLabel->setPixmap(*page);
  textPageLabel->resize(page->size());
}

